<div class="toploggedin">
	<div class="display_picturetop">
		<?php echo $this->Html->image('/attachments/avatars/large/' . AuthComponent::User('user_file_path')); ?>
	</div>
	<div>
		<?php echo AuthComponent::User('username'); ?>
		<?php echo $this->Html->link("Logout", array("controller" => "users", "action" => "logout"), array("class" => "toplogoutlink")); ?>
		<br />
		<?php echo $this->Html->link("Account info", array("controller" => "users", "action" => "account")); ?>
		<?php echo $this->Html->image((AuthComponent::User('message_count') > 0) ? 'email1.png' : 'email2.png', array("alt" => "messages")); ?>

		<span style="float: right"><?php echo AuthComponent::User('message_count'); ?>&nbsp;</span>

		<?php echo $this->Html->link('Private messages', array("controller" => "messages", "action" => "index")); ?>
		<br />
		<div style="float: right">
		<?php if(AuthComponent::User('role') > 2): ?>
		<a href="#" id="adminOptionsLink">Admin options</a>
		<?php endif; ?>
		</div>
		<?php echo $this->Html->link('Login history', array('controller' => 'users', 'action' => 'history')); ?>

	</div>
	<div style="clear: both"></div>
</div>